//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.cancel.asyncImage;

import android.content.Context;
import android.os.Environment;
import java.io.File;

public class FileCache {
    private File cacheDir;

    public FileCache(Context context, String pathNmae) {
        if(Environment.getExternalStorageState().equals("mounted")) {
            this.cacheDir = new File(Environment.getExternalStorageDirectory(), pathNmae);
        } else {
            this.cacheDir = context.getCacheDir();
        }

        if(!this.cacheDir.exists()) {
            this.cacheDir.mkdirs();
        }

    }

    public File getFile(String url) {
        String filename = String.valueOf(url.hashCode());
        File f = new File(this.cacheDir, filename);
        return f;
    }

    public void clear() {
        File[] files = this.cacheDir.listFiles();
        if(files != null) {
            File[] var5 = files;
            int var4 = files.length;

            for(int var3 = 0; var3 < var4; ++var3) {
                File f = var5[var3];
                f.delete();
            }

        }
    }
}
